<template>
  <el-dialog
    :title="'继承现有'"
    :visible.sync="dialogVisible"
    width="30%"
    customClass="mes_dialog work_order_batch"
    v-dialogDrag
    :close-on-click-modal="false"
    @close="closeDialog">
    <div class="inherit_content" v-loading="isLoading" element-loading-text="继承中">
    </div>
    <span slot="footer" class="mes_btn">
        <el-button @click="dialogVisible = false">关闭</el-button>
    </span>
  </el-dialog>
</template>

<script>
export default {
  name: 'InheritDialog',
  data() {
    return {
      dialogVisible: false, // 弹窗显示
      inheritToken: null, // 继承请求token
      isLoading: false, // 继承加载中
    }
  },
  methods: {
    openDialog(inheritToken) {
      this.inheritToken = inheritToken
      this.dialogVisible = true
      this.isLoading = true
    },
    // 关闭弹窗
    closeDialog() {
      this.inheritToken.cancel()
    },
    /**
     * 提示
     * @param type 提示类型
     * @param str 提示内容
     */
    tipMessage(type, str) {
      this.$message({
        type: type,
        message: str,
        duration: 1500,
        center: true
      })
    }
  }
}
</script>

<style lang="less">
  .inherit_content{
    height: 100px;
  }
</style>
